'use client'

import { ReactNode, useEffect } from 'react'
import { useNavigation } from '@/app/context/navigation-context'

interface KnowledgeLayoutProps {
  children: ReactNode
}

export default function KnowledgeLayout({ children }: KnowledgeLayoutProps) {
  const { setCurrentSection } = useNavigation()

  // 使用 useEffect 来设置当前导航区域
  useEffect(() => {
    setCurrentSection('knowledge')
  }, [setCurrentSection])

  return (
    <div className="container mx-auto px-4">
      <div className="flex flex-col space-y-6">
        {/* 页面标题 */}
        <div className="flex items-center justify-between py-4">
          <h1 className="text-2xl font-semibold">知识库</h1>
        </div>

        {/* 主要内容区域 */}
        <div className="bg-white rounded-lg shadow">
          {children}
        </div>
      </div>
    </div>
  )
} 